package leetcode;
//2021蓝桥杯时间显示
import java.util.Scanner;

public class Time_display {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        int a=mod(s,86400000);
//        System.out.println(a);
        System.out.printf("%02d:%02d:%02d",a/3600000,(a%3600000)/60000,((a%3600000)%60000)/1000);
//        System.out.printf((a%3600000)/60000+":");
//        System.out.printf(((a%3600000)%60000)/1000);
    }
    static int mod(String s,int n) {
        int len = 9;
        int val = Integer.parseInt(s.substring(Math.max(s.length() - len, 0))) % n;
        if (s.length() <= len)return val;
        return (int)(((long)(Math.pow(10,len)%n)*(mod(s.substring(0,s.length()-len),n)))%n+val)%n;
    }
}
